// 引入自己配置的axios
import http from './axios';
import Vue from 'vue'

// 获取菜单列表  ---------------------------------------------------------------
export const getMenuListApi = () => {
    // istree=1 加了这个就是树形结构
    return http('/menulist?istree=1')
}

// 删除菜单
export const delMenuApi = (id) => {
    return http.post('/menudelete',{id:id})
}

// 修改菜单
export const editMenuApi = (data) => {
    return http.post('/menuedit',data)
}



// 获取角色列表 ---------------------------------------------------------------
export const getRoleListApi = () => {
    return http('/rolelist')
}

// 添加角色列表
export const addRoleListApi = (data) => {
    return http.post('/roleadd',data)
}


// 删除角色列表
export const delRoleListApi = (id) => {
    return http.post('/roledelete',{id})
}

// 编辑角色列表
export const editRoleListApi = (data) => {
    return http.post('/roleedit',data)
}




// 获取管理员列表 --------------------------------------------------------------
export const getAdminListApi = () => {
    return http('/userlist?size=10&page=1')
}


// 编辑管理员列表
export const editAdminListApi = (data) => {
    return http.post('/useredit',data)
}


// 删除管理员列表
export const delAdminListApi = (id) => {
    return http.post('/userdelete',{id})
}



